package formbeans;

import java.util.ArrayList;
import java.util.List;

import org.mybeans.form.FormBean;

public class SocioCognitiveForm extends FormBean {

	private String question;
	private String dynetmlAttr;
	private String classNameSource;
	private String classNameTarget;
	private String aggregate;
	
	public String getQuestion() {
		return question;
	}
	public String getDynetmlAttr() {
		return dynetmlAttr;
	}
	public String getClassNameSource() {
		return classNameSource;
	}
	public String getClassNameTarget() {
		return classNameTarget;
	}
	public String getAggregate() {
		return aggregate;
	}

	public void setQuestion(String question) {
		this.question = trimAndConvert(question,"<>\"");
	}
	public void setDynetmlAttr(String dynetmlAttr) {
		this.dynetmlAttr = trimAndConvert(dynetmlAttr, "<>\"");
	}
	public void setClassNameSource(String classNameSource) {
		this.classNameSource = classNameSource;
	}
	public void setClassNameTarget(String classNameTarget) {
		this.classNameTarget = classNameTarget;
	}
	public void setAggregate(String aggregate) {
		this.aggregate = aggregate;
	}
	
	public List<String> checkSocioCognitiveFormErrors(){
		List<String> errors = new ArrayList<String>();
		
		if(question == null || question.length() == 0){
			errors.add("Please enter a question");
		}
		if(dynetmlAttr == null || dynetmlAttr.length() == 0){
			errors.add("Please enter description for \"dynetml attribute identifier\"");
		}
		
		return errors;
	}
}